package com.cskaoyan.service;


import com.cskaoyan.bean.Assignedpermissions;
import com.cskaoyan.bean.Permissions;

import com.cskaoyan.bean.Systempermissionsbean;
import com.cskaoyan.mapper.AssignedpermissionsMapper;
import com.cskaoyan.mapper.SystempermissionsbeanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ServiceImpl  implements ServiceO{
    @Autowired
    AssignedpermissionsMapper assignedpermissionsMapper;
    @Autowired
    SystempermissionsbeanMapper systempermissionsbeanMapper;

    Assignedpermissions assignedpermissions = new Assignedpermissions();
    Systempermissionsbean systempermissionsbean = new Systempermissionsbean();
    @Override
    public void create(List<String> strings) {
        for(String s : strings){
            assignedpermissions.setApi(s);
            assignedpermissionsMapper.insertSelective(assignedpermissions);
        }
    }

    @Override
    public void createsys(List<Permissions.SystemPermissionsBean> systemPermissions) {
        for(Permissions.SystemPermissionsBean s : systemPermissions){
            systempermissionsbean.setId(s.getId());
            systempermissionsbean.setId(s.getLabel());
            systempermissionsbeanMapper.insert(systempermissionsbean);
        }

    }
}
